import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
/* Layout */
import Layout from "@/layout";
export const constantRoutes = [
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true
  },
  {
    path: "/",
    component: Layout,
    redirect: "/dashboard",
    children: [
      {
        path: "dashboard",
        name: "Dashboard",
        component: () => import("@/views/dashboard/index"),
        meta: { title: "首页", icon: "dashboard" }
      }
    ]
  },
  {
    path: "/download",
    component: () => import("@/views/download/index")
  }
];

export const asyncRoutes = [
  {
    path: "/permission",
    component: Layout,
    redirect: "/permission/roleList",
    name: "权限设置",
    id: 100000,
    meta: {
      title: "权限设置",
      icon: "lock",
      role: []
    },
    children: [
      {
        path: "roleList",
        name: "角色管理",
        id: 100100,
        parentId: 100000,
        component: () => import("@/views/permission/roleList/index"),
        meta: { title: "角色管理", role: [] }
      },
      {
        path: "adminList",
        name: "管理员列表",
        id: 100200,
        parentId: 100000,
        component: () => import("@/views/permission/adminList/index"),
        meta: { title: "管理员列表", role: [] }
      },
      {
        path: "permissionResource",
        name: "权限资源列表",
        id: 100300,
        parentId: 100000,
        component: () => import("@/views/permission/permissionResource/index"),
        meta: { title: "权限资源列表", role: [] }
      },
      {
        path: "rightsGroup",
        name: "权限分组列表",
        id: 100400,
        parentId: 100000,
        component: () => import("@/views/permission/rightsGroup/index"),
        meta: { title: "权限分组列表", role: [] }
      }
    ]
  },
  {
    path: "/storeManagement",
    component: Layout,
    redirect: "/storeManagement/storeList",
    name: "客户管理",
    id: 110000,
    meta: {
      title: "客户管理",
      icon: "store",
      role: []
    },
    children: [
      {
        path: "storeList",
        name: "客户列表",
        id: 110100,
        parentId: 110000,
        component: () => import("@/views/storeManagement/storeList/index"),
        meta: { title: "客户列表", role: [] }
      }
    ]
  },
  {
    path: "/commodity",
    component: Layout,
    redirect: "/commodity/commodityList",
    name: "商品管理",
    id: 120000,
    meta: {
      title: "商品管理",
      icon: "commodity",
      role: []
    },
    children: [
      {
        path: "commodityList",
        name: "商品列表",
        id: 120100,
        parentId: 120000,
        component: () => import("@/views/commodity/commodityList/index"),
        meta: { title: "商品列表", role: [] }
      },
      {
        path: "classifyList",
        name: "分类列表",
        id: 120200,
        parentId: 120000,
        component: () => import("@/views/commodity/classifyList/index"),
        meta: { title: "分类列表", role: [] }
      },
      {
        path: "accessDetails",
        name: "入库详情",
        id: 120300,
        parentId: 120000,
        component: () => import("@/views/commodity/accessDetails/index"),
        meta: { title: "入库详情", role: [] }
      },
      {
        path: "outDetails",
        name: "出库详情",
        id: 120400,
        parentId: 120000,
        component: () => import("@/views/commodity/outDetails/index"),
        meta: { title: "出库详情", role: [] }
      },
      {
        path: "repertoryList",
        name: "库存列表(供应商)",
        id: 120500,
        parentId: 120000,
        component: () => import("@/views/commodity/repertoryList/index"),
        meta: { title: "库存列表(供应商)", role: [] }
      },
      {
        path: "inventoryList",
        name: "库存列表",
        id: 121100,
        parentId: 120000,
        component: () => import("@/views/commodity/inventoryList/index"),
        meta: { title: "库存列表", role: [] }
      },

      {
        path: "superCommodityList",
        name: "商超商品列表",
        id: 120600,
        parentId: 120000,
        component: () => import("@/views/commodity/superCommodityList/index"),
        meta: { title: "商超商品列表", role: [], keepAlive: false }
      },
      {
        path: "superClassList",
        name: "商超分类列表",
        id: 120800,
        parentId: 120000,
        component: () => import("@/views/commodity/superClassList/index"),
        meta: { title: "商超分类列表", role: [] }
      },

      {
        path: "shopnumList",
        name: "商超商品库存列表",
        id: 120900,
        parentId: 120000,
        component: () => import("@/views/commodity/shopnumList/index"),
        meta: { title: "商超商品库存列表", role: [] }
      },
      {
        path: "shopnumNewList",
        name: "商超商品库存列表(供应商)",
        id: 121500,
        parentId: 120000,
        component: () => import("@/views/commodity/shopnumNewList/index"),
        meta: { title: "商超商品库存列表(供应商)", role: [] }
      },
      {
        path: "shopinoutList",
        name: "商超出入库列表",
        id: 121000,
        parentId: 120000,
        component: () => import("@/views/commodity/shopinoutList/index"),
        meta: { title: "商超出入库列表", role: [] }
      },
      {
        path: "shopCookedList",
        name: "商超休闲食品列表",
        id: 121200,
        parentId: 120000,
        component: () => import("@/views/commodity/shopCookedList/index"),
        meta: { title: "商超休闲食品列表", role: [] }
      },
      {
        path: "goodsShelvesList",
        component: () => import("@/views/commodity/goodsShelvesList/index"),
        name: "商品设置货架管理",
        meta: {
          title: "商品设置货架管理",
          noCache: true,
          activeMenu: "/commodity/goodsShelvesList"
        },
        hidden: true
      },
      {
        path: "turnoverList",
        name: "商超周转数据统计",
        id: 121300,
        parentId: 120000,
        component: () => import("@/views/commodity/turnoverList/index"),
        meta: { title: "商超周转数据统计", role: [] }
      },
      {
        path: "superTurnoverList",
        name: "商超周转数据报表",
        id: 121400,
        parentId: 120000,
        component: () => import("@/views/commodity/superTurnoverList/index"),
        meta: { title: "商超周转数据报表", role: [] }
      }
    ]
  },
  {
    path: "/supplier",
    component: Layout,
    redirect: "/supplier/supplierList",
    name: "供应商",
    id: 130000,
    meta: {
      title: "供应商",
      icon: "supplier",
      role: []
    },
    children: [
      {
        path: "supplierList",
        name: "供应商列表",
        id: 130100,
        parentId: 130000,
        component: () => import("@/views/supplier/supplierList/index"),
        meta: { title: "供应商列表", role: [] }
      }
      // {
      //     path: 'superSupplierList',
      //     name: '商超供应商列表',
      //     id: 130200,
      //     parentId: 130000,
      //     component: () =>
      //         import('@/views/supplier/superSupplierList/index'),
      //     meta: { title: '商超供应商列表', role: [] }
      // }
    ]
  },
  {
    path: "/select",
    component: Layout,
    redirect: "/select/selectList",
    name: "仓库与配送中心",
    id: 140000,
    meta: { title: "仓库与配送中心", icon: "entrepot", role: [] },
    children: [
      {
        path: "entrepotList",
        name: "仓库管理",
        id: 140100,
        parentId: 140000,
        component: () => import("@/views/select/entrepotList/index"),
        meta: { title: "仓库管理", role: [] }
      },
      {
        path: "selectList",
        name: "配送中心管理",
        id: 140200,
        parentId: 140000,
        component: () => import("@/views/select/selectList/index"),
        meta: { title: "配送中心管理", role: [] }
      },
      {
        path: "helvesList",
        name: "货架管理",
        id: 140300,
        parentId: 140000,
        component: () => import("@/views/select/helvesList/index"),
        meta: { title: "货架管理", role: [] }
      },
      {
        path: "houseAreaList",
        component: () => import("@/views/select/houseAreaList/index"),
        name: "区域管理",
        meta: {
          title: "区域管理",
          noCache: true,
          activeMenu: "/select/houseAreaList"
        },
        hidden: true
      },
      {
        path: "areaShelvesList",
        component: () => import("@/views/select/areaShelvesList/index"),
        name: "区域设置货架管理",
        meta: {
          title: "区域设置货架管理",
          noCache: true,
          activeMenu: "/select/areaShelvesList"
        },
        hidden: true
      }
    ]
  },
  {
    path: "/sorting",
    component: Layout,
    redirect: "/sorting/sortingList",
    name: "加工",
    id: 150000,
    meta: {
      title: "加工",
      icon: "sorting",
      role: []
    },
    children: [
      //     {
      //     path: 'sortingList',
      //     name: '可加工列表',
      //     id: 150100,
      //     parentId: 150000,
      //     component: () =>
      //         import('@/views/sorting/sortingList/index'),
      //     meta: { title: '可加工列表', role: [] }
      // },
      {
        path: "sortingBatchList",
        name: "已加工列表",
        id: 150200,
        parentId: 150000,
        component: () => import("@/views/sorting/sortingBatchList/index"),
        meta: { title: "已加工列表", role: [] }
      }
    ]
  },
  // {
  //     path: '/superIndent',
  //     component: Layout,
  //     redirect: '/superIndent/superIndentList',
  //     name: '商超订货单',
  //     id: 380000,
  //     meta: { title: '商超订货单', icon: 'indent', role: [] },
  //     children: [{
  //         path: 'superIndentList',
  //         name: '商超订货单列表',
  //         id: 380100,
  //         parentId: 380000,
  //         component: () =>
  //             import('@/views/superIndent/superIndentList/index'),
  //         meta: { title: '商超订货单列表', role: [] }
  //     }]

  // },
  {
    path: "/putStorage",
    component: Layout,
    redirect: "/putStorage/putStorageList",
    name: "入库单",
    id: 160000,
    meta: {
      title: "入库单",
      icon: "putStorage",
      role: []
    },
    children: [
      {
        path: "putStorageList",
        name: "入库单列表",
        id: 160100,
        parentId: 160000,
        component: () => import("@/views/putStorage/putStorageList/index"),
        meta: { title: "入库单列表", role: [] }
      },
      // {
      //     path: 'giftPutStorageList',
      //     name: '赠品入库单列表',
      //     id: 160200,
      //     parentId: 160000,
      //     component: () =>
      //         import('@/views/putStorage/giftPutStorageList/index'),
      //     meta: { title: '赠品入库单列表', role: [] }
      // },
      {
        path: "superPurchaseList",
        name: "商超购货单列表",
        id: 160300,
        parentId: 160000,
        component: () => import("@/views/putStorage/superPurchaseList/index"),
        meta: { title: "商超购货单列表", role: [] }
      },
      {
        path: "superInyPurchaseList",
        name: "商超库存购货单",
        id: 160400,
        parentId: 160000,
        component: () =>
          import("@/views/putStorage/superInyPurchaseList/index"),
        meta: { title: "商超库存购货单", role: [] }
      }
    ]
  },
  {
    path: "/superAllot",
    component: Layout,
    redirect: "/superAllot/superAllotList",
    name: "商超调拨单",
    id: 360000,
    meta: {
      title: "商超调拨单",
      icon: "allot",
      role: []
    },
    children: [
      {
        path: "superAllotList",
        name: "商超调拨单列表",
        id: 360100,
        parentId: 360000,
        component: () => import("@/views/superAllot/superAllotList/index"),
        meta: { title: "商超调拨单列表", role: [] }
      }
    ]
  },
  {
    path: "/allot",
    component: Layout,
    redirect: "/allot/allotList",
    name: "中仓调拨单",
    id: 360001,
    meta: {
      title: "中仓调拨单",
      icon: "allot",
      role: []
    },
    children: [
      {
        path: "allotList",
        name: "中仓调拨单列表",
        id: 360101,
        parentId: 360001,
        component: () => import("@/views/allot/allotList/index"),
        meta: { title: "中仓调拨单列表", role: [] }
      }
    ]
  },
  {
    path: "/check",
    component: Layout,
    redirect: "/check/checkList",
    name: "盘点",
    id: 170000,
    meta: {
      title: "盘点",
      icon: "check",
      role: []
    },
    children: [
      {
        path: "checkList",
        name: "盘点列表",
        id: 170100,
        parentId: 170000,
        component: () => import("@/views/check/checkList/index"),
        meta: { title: "盘点列表", role: [] }
      },
      {
        path: "checkDetail",
        name: "盘点明细",
        id: 170200,
        parentId: 170000,
        component: () => import("@/views/check/checkDetail/index"),
        meta: { title: "盘点明细", role: [] }
      },
      {
        path: "superCheckGoodsList",
        name: "预盘点单商品列表",
        id: 170300,
        parentId: 170000,
        component: () => import("@/views/check/superCheckGoodsList/index"),
        meta: { title: "预盘点单商品列表", role: [] }
      },
      {
        path: "checkPlanList",
        name: "盘点计划单列表",
        id: 170400,
        parentId: 170000,
        component: () => import("@/views/check/checkPlanList/index"),
        meta: { title: "盘点计划单列表", role: [] }
      },
      {
        path: "superCheckList",
        name: "商超盘点差异列表",
        id: 170500,
        parentId: 170000,
        component: () => import("@/views/check/superCheckList/index"),
        meta: { title: "商超盘点差异列表", role: [] }
      },
      {
        path: "superCollectList",
        name: "商超手持盘点采集单",
        id: 170600,
        parentId: 170000,
        component: () => import("@/views/check/superCollectList/index"),
        meta: { title: "商超手持盘点采集单", role: [] }
      },
      {
        path: "superCollectCheckList",
        name: "商超手持差异单",
        id: 170600,
        parentId: 170000,
        component: () => import("@/views/check/superCollectCheckList/index"),
        meta: { title: "商超手持差异单", role: [] }
      }
    ]
  },
  // {
  //   path: '/enquiry',
  //   component: Layout,
  //   redirect: '/enquiry/shopOrderList',
  //   name: '要货单',
  //   id: 70,
  //   meta: {
  //     title: '要货单',
  //     icon: 'enquiry',
  //     role: []
  //   },
  //   children: [{
  //     path: 'shopOrderList',
  //     name: '要货单列表',
  //     id: 71,
  //     parentId: 70,
  //     component: () =>
  //       import('@/views/enquiry/shopOrderList/index'),
  //     meta: { title: '要货单列表', role: [] }
  //   },
  //   {
  //     path: 'shopOrderGoods',
  //     name: '要货单商品',
  //     id: 72,
  //     parentId: 70,
  //     component: () =>
  //       import('@/views/enquiry/shopOrderGoods/index'),
  //     meta: { title: '要货单商品', role: [] }
  //   },

  //   ]
  // },
  {
    path: "/sortGoods",
    component: Layout,
    redirect: "/sortGoods/sortGoodsList",
    name: "分货单",
    id: 180000,
    meta: {
      title: "分货单",
      icon: "enquiry",
      role: []
    },
    children: [
      {
        path: "sortGoodsList",
        name: "分货单列表",
        id: 180100,
        parentId: 180000,
        component: () => import("@/views/sortGoods/sortGoodsList/index"),
        meta: { title: "分货单列表", role: [] }
      }
    ]
  },
  // {
  //     path: '/zhongcangorder',
  //     component: Layout,
  //     redirect: '/zhongcangorder/zhongcangorderList',
  //     name: '中仓订单列表',
  //     id: 350000,
  //     meta: { title: '中仓订单列表', icon: 'order', role: [] },
  //     children: [{
  //         path: 'zhongcangorderList',
  //         name: '中仓订单列表',
  //         id: 350100,
  //         parentId: 350000,
  //         component: () =>
  //             import('@/views/zhongcangorder/zhongcangorderList/index'),
  //         meta: { title: '中仓订单列表', role: [] }
  //     },
  //     ]
  // },
  {
    path: "/superOrder",
    component: Layout,
    redirect: "/superOrder/superOrderList",
    name: "商超订单",
    id: 190000,
    meta: {
      title: "商超订单",
      icon: "order",
      role: []
    },
    children: [
      {
        path: "superOrderList",
        name: "商超订单列表",
        id: 190100,
        parentId: 190000,
        component: () => import("@/views/superOrder/superOrderList/index"),
        meta: { title: "商超订单列表", role: [] }
      }
    ]
  },
  {
    path: "/superOrderNew",
    component: Layout,
    redirect: "/superOrderNew/superOrderList",
    name: "商超订单(新)",
    id: 400000,
    meta: {
      title: "商超订单",
      icon: "order",
      role: []
    },
    children: [
      {
        path: "superOrderList",
        name: "商超订单列表(新)",
        id: 400100,
        parentId: 400000,
        component: () => import("@/views/superOrderNew/superOrderList/index"),
        meta: { title: "商超订单列表(新)", role: [] }
      }
    ]
  },
  {
    path: "/settlement",
    component: Layout,
    redirect: "/settlement/settlementList",
    name: "结算单",
    id: 200000,
    meta: {
      title: "结算单",
      icon: "settlement",
      role: []
    },
    children: [
      {
        path: "settlementList",
        name: "结算单列表",
        id: 200100,
        parentId: 200000,
        component: () => import("@/views/settlement/settlementList/index"),
        meta: { title: "结算单列表", role: [] }
      },
      {
        path: "settlementListtwo",
        name: "结算单处理结算列表",
        id: 82,
        parentId: 80,
        component: () => import("@/views/settlement/settlementListtwo/index"),
        meta: { title: "结算单处理结算列表", role: [] }
      },
      {
        path: "financialSettlement",
        name: "财务供应商付款单列表",
        id: 200200,
        parentId: 200000,
        component: () => import("@/views/settlement/financialSettlement/index"),
        meta: { title: "财务供应商付款单列表", role: [] }
      },
      {
        path: "financeList",
        name: "财务结算单列表",
        id: 200300,
        parentId: 200000,
        component: () => import("@/views/settlement/financeList/index"),
        meta: { title: "财务结算单列表", role: [] }
      },
      {
        path: "bankList",
        name: "银行账户列表",
        id: 200400,
        parentId: 200000,
        component: () => import("@/views/settlement/bankList/index"),
        meta: { title: "银行账户列表", role: [] }
      },
      {
        path: "sendfalseList",
        name: "线上支付失败列表",
        id: 200500,
        parentId: 200000,
        component: () => import("@/views/settlement/sendfalseList/index"),
        meta: { title: "线上支付失败列表", role: [] }
      },
      {
        path: "rePayList",
        name: "申请重新支付列表",
        id: 200600,
        parentId: 200000,
        component: () => import("@/views/settlement/rePayList/index"),
        meta: { title: "申请重新支付列表", role: [] }
      }
    ]
  },
  {
    path: "/superSettlement",
    component: Layout,
    redirect: "/superSettlement/settlementList",
    name: "商超结算单",
    id: 210000,
    meta: {
      title: "商超结算单",
      icon: "superSettlement",
      role: []
    },
    children: [
      {
        path: "settlementList",
        name: "商超结算单列表",
        id: 210100,
        parentId: 210000,
        component: () => import("@/views/superSettlement/settlementList/index"),
        meta: { title: "商超结算单列表", role: [] }
      },
      {
        path: "settlementListtwo",
        name: "商超结算单处理结算列表",
        id: 221,
        parentId: 220,
        component: () =>
          import("@/views/superSettlement/settlementListtwo/index"),
        meta: { title: "商超结算单处理结算列表", role: [] }
      },
      {
        path: "financialSettlement",
        name: "商超付款单列表",
        id: 210200,
        parentId: 210000,
        component: () =>
          import("@/views/superSettlement/financialSettlement/index"),
        meta: { title: "商超付款单列表", role: [] }
      },
      {
        path: "financeList",
        name: "商超财务结算单列表",
        id: 210300,
        parentId: 210000,
        component: () => import("@/views/superSettlement/financeList/index"),
        meta: { title: "商超财务结算单列表", role: [] }
      },
      {
        path: "bankList",
        name: "商超银行账户列表",
        id: 210400,
        parentId: 210000,
        component: () => import("@/views/superSettlement/bankList/index"),
        meta: { title: "商超银行账户列表", role: [] }
      },
      {
        path: "supersendfalseList",
        name: "商超线上支付失败列表",
        id: 200500,
        parentId: 210000,
        component: () =>
          import("@/views/superSettlement/supersendfalseList/index"),
        meta: { title: "商超线上支付失败列表", role: [] }
      },
      {
        path: "rePayList",
        name: "申请重新支付列表",
        id: 200600,
        parentId: 210000,
        component: () => import("@/views/superSettlement/rePayList/index"),
        meta: { title: "申请重新支付列表", role: [] }
      }
    ]
  },

  {
    path: "/salesReturn",
    component: Layout,
    redirect: "/salesReturn/salesReturnList",
    name: "退货单",
    id: 220000,
    meta: {
      title: "退货单",
      icon: "salesReturn",
      role: []
    },
    children: [
      {
        path: "salesReturnList",
        name: "退货单列表",
        id: 220100,
        parentId: 220000,
        component: () => import("@/views/salesReturn/salesReturnList/index"),
        meta: { title: "退货单列表", role: [] }
      },
      {
        path: "salesReturnaddList",
        name: "退货单列表(中仓自建)",
        id: 220300,
        parentId: 220000,
        component: () => import("@/views/salesReturn/salesReturnaddList/index"),
        meta: { title: "退货单列表(中仓自建)", role: [] }
      },
      {
        path: "superSalesReturnList",
        name: "商超退货单列表",
        id: 220200,
        parentId: 220000,
        component: () =>
          import("@/views/salesReturn/superSalesReturnList/index"),
        meta: { title: "商超退货单列表", role: [] }
      }
    ]
  },
  {
    path: "/returnGoods",
    component: Layout,
    redirect: "/returnGoods/returnGoodsList",
    name: "返货单",
    id: 230000,
    meta: {
      title: "返货单",
      icon: "returnGoods",
      role: []
    },
    children: [
      {
        path: "returnGoodsList",
        name: "返货单列表",
        id: 230100,
        parentId: 230000,
        component: () => import("@/views/returnGoods/returnGoodsList/index"),
        meta: { title: "返货单列表", role: [] }
      },
      {
        path: "superRetumGoodsList",
        name: "商超返货单列表",
        id: 230200,
        parentId: 230000,
        component: () =>
          import("@/views/returnGoods/superRetumGoodsList/index"),
        meta: { title: "商超返货单列表", role: [] }
      }
    ]
  },
  {
    path: "/changeAccount",
    component: Layout,
    redirect: "/changeAccount/changeAccountList",
    name: "改账单",
    id: 430000,
    meta: {
      title: "改账单",
      icon: "changeAccount",
      role: []
    },
    children: [
      {
        path: "changeAccountList",
        name: "改账单列表",
        id: 430100,
        parentId: 430000,
        component: () =>
          import("@/views/changeAccount/changeAccountList/index"),
        meta: { title: "改账单列表", role: [] }
      },
      {
        path: "superChangeAccount",
        name: "商超改账单列表",
        id: 430200,
        parentId: 430000,
        component: () =>
          import("@/views/changeAccount/superChangeAccount/index"),
        meta: { title: "商超改账单列表", role: [] }
      }
    ]
  },
  {
    path: "/grossMargin",
    component: Layout,
    redirect: "/grossMargin/dateGrossMarginList",
    name: "报表",
    id: 240000,
    meta: {
      title: "报表",
      icon: "grossMargin",
      role: []
    },
    children: [
      {
        path: "dateGrossMarginList",
        name: "时间毛利报表",
        id: 240100,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/dateGrossMarginList/index"),
        meta: { title: "时间毛利报表", role: [] }
      },
      {
        path: "listGrossMarginList",
        name: "分类毛利报表",
        id: 240200,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/listGrossMarginList/index"),
        meta: { title: "分类毛利报表", role: [] }
      },
      {
        path: "goodsGrossMarginList",
        name: "商品毛利报表",
        id: 240300,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/goodsGrossMarginList/index"),
        meta: { title: "商品毛利报表", role: [] }
      },
      {
        path: "putMarginList",
        name: "入库明细报表",
        id: 240400,
        parentId: 240000,
        component: () => import("@/views/grossMargin/putMarginList/index"),
        meta: { title: "入库明细报表", role: [] }
      },
      {
        path: "collectMarginList",
        name: "入库汇总报表",
        id: 240500,
        parentId: 240000,
        component: () => import("@/views/grossMargin/collectMarginList/index"),
        meta: { title: "入库汇总报表", role: [] }
      },
      {
        path: "sellMarainList",
        name: "销售报表",
        id: 240600,
        parentId: 240000,
        component: () => import("@/views/grossMargin/sellMarainList/index"),
        meta: { title: "销售报表", role: [] }
      },
      {
        path: "sellMarainNewList",
        name: "销售报表(新)",
        id: 241600,
        parentId: 240000,
        component: () => import("@/views/grossMargin/sellMarainNewList/index"),
        meta: { title: "销售报表(新)", role: [] }
      },
      {
        path: "sellMarainNewAllList",
        name: "销售汇总报表（新）",
        id: 242700,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/sellMarainNewAllList/index"),
        meta: { title: "销售汇总报表（新）", role: [] }
      },
      {
        path: "salesReturnList",
        name: "退货报表(新)",
        id: 241700,
        parentId: 240000,
        component: () => import("@/views/grossMargin/salesReturnList/index"),
        meta: { title: "退货报表(新)", role: [] }
      },
      {
        path: "salesReturnAllList",
        name: "退货汇总报表（新）",
        id: 242800,
        parentId: 240000,
        component: () => import("@/views/grossMargin/salesReturnAllList/index"),
        meta: { title: "退货汇总报表（新）", role: [] }
      },
      {
        path: "salesReturnaddList",
        name: "退货报表(中仓自建)",
        id: 242000,
        parentId: 240000,
        component: () => import("@/views/grossMargin/salesReturnaddList/index"),
        meta: { title: "退货报表(中仓自建)", role: [] }
      },
      {
        path: "settleMarainList",
        name: "结算报表",
        id: 240700,
        parentId: 240000,
        component: () => import("@/views/grossMargin/settleMarainList/index"),
        meta: { title: "结算报表", role: [] }
      },
      {
        path: "allocatepriceMarainList",
        name: "调货提成明细表",
        id: 240800,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/allocatepriceMarainList/index"),
        meta: { title: "调货提成明细表", role: [] }
      },
      {
        path: "allcollectMarainList",
        name: "调货提成汇总表",
        id: 240900,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/allcollectMarainList/index"),
        meta: { title: "调货提成汇总表", role: [] }
      },
      {
        path: "cargoReportMarainList",
        name: "预提费/溢折值明细",
        id: 241000,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/cargoReportMarainList/index"),
        meta: { title: "预提费/溢折值明细", role: [] }
      },
      {
        path: "cargoReportMarainNewList",
        name: "销售预提费/溢折值明细",
        id: 241800,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/cargoReportMarainNewList/index"),
        meta: { title: "销售预提费/溢折值明细", role: [] }
      },
      {
        path: "retutnMarainNewList",
        name: "退货预提费/溢折值明细",
        id: 241900,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/retutnMarainNewList/index"),
        meta: { title: "退货预提费/溢折值明细", role: [] }
      },
      {
        path: "cargoSummaryReportList",
        name: "预提费/溢折值汇总",
        id: 241100,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/cargoSummaryReportList/index"),
        meta: { title: "预提费/溢折值汇总", role: [] }
      },
      {
        path: "wmsReportReportList",
        name: "收发存明细报表",
        id: 241200,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/wmsReportReportList/index"),
        meta: { title: "收发存明细报表", role: [] }
      },
      {
        path: "ReportWmsReportList",
        name: "收发存汇总报表",
        id: 241300,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/ReportWmsReportList/index"),
        meta: { title: "收发存汇总报表", role: [] }
      },
      {
        path: "payableReportList",
        name: "应付账款明细报表",
        id: 241400,
        parentId: 240000,
        component: () => import("@/views/grossMargin/payableReportList/index"),
        meta: { title: "应付账款明细报表", role: [] }
      },
      {
        path: "payableAllReportList",
        name: "应付账款汇总报表",
        id: 241500,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/payableAllReportList/index"),
        meta: { title: "应付账款汇总报表", role: [] }
      },
      {
        path: "purchaseSummaryList",
        name: "综合费用查询",
        id: 241600,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/purchaseSummaryList/index"),
        meta: { title: "综合费用查询", role: [] }
      },
      {
        path: "supermarketMarkupReportList",
        name: "商超商品销售加价报表",
        id: 242100,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/supermarketMarkupReportList/index"),
        meta: { title: "商超商品销售加价报表", role: [] }
      },
      {
        path: "quotientClassificationReportList",
        name: "商超分类销售加价报表",
        id: 242200,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/quotientClassificationReportList/index"),
        meta: { title: "商超分类销售加价报表", role: [] }
      },

      {
        path: "supermarketCommodityreportList",
        name: "商超商品退货加价报表",
        id: 242300,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/supermarketCommodityreportList/index"),
        meta: { title: "商超商品退货加价报表", role: [] }
      },
      {
        path: "supermarketClassificationReportList",
        name: "商超分类退货加价报表",
        id: 242400,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/supermarketClassificationReportList/index"),
        meta: { title: "商超分类退货加价报表", role: [] }
      },
      {
        path: "commodityTransferReportList",
        name: "商超商品调拨加价报表",
        id: 242500,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/commodityTransferReportList/index"),
        meta: { title: "商超商品调拨加价报表", role: [] }
      },
      {
        path: "supermarketClassificationMarkupReportList",
        name: "商超分类调拨加价报表",
        id: 242600,
        parentId: 240000,
        component: () =>
          import("@/views/grossMargin/supermarketClassificationMarkupReportList/index"),
        meta: { title: "商超分类调拨加价报表", role: [] }
      }
    ]
  },
  {
    path: "/superGrossMargin",
    component: Layout,
    redirect: "/superGrossMargin/superGrossMarginList",
    name: "商超应付账款",
    id: 250000,
    meta: { title: "商超应付账款", icon: "form", role: [] },
    children: [
      {
        path: "superGrossMarginList",
        name: "商超应付账款明细报表",
        id: 250100,
        parentId: 250000,
        component: () =>
          import("@/views/superGrossMargin/superGrossMarginList/index"),
        meta: { title: "商超应付账款明细报表", role: [] }
      },
      {
        path: "superGrossMarginAllList",
        name: "商超应付账款汇总报表",
        id: 250200,
        parentId: 250000,
        component: () =>
          import("@/views/superGrossMargin/superGrossMarginAllList/index"),
        meta: { title: "商超应付账款汇总报表", role: [] }
      }
    ]
  },
  {
    path: "/voucher",
    component: Layout,
    redirect: "/voucher/purchaseVoucher",
    name: "凭证",
    id: 260000,
    meta: {
      title: "凭证",
      icon: "voucher",
      role: []
    },
    children: [
      {
        path: "salecertification",
        name: "销售凭证（分货单）",
        id: 260100,
        parentId: 260000,
        component: () => import("@/views/voucher/salecertification/index"),
        meta: { title: "销售凭证（分货单）", role: [] }
      },
      {
        path: "salecertificationNew",
        name: "销售凭证(分货单新)",
        id: 261600,
        parentId: 260000,
        component: () => import("@/views/voucher/salecertificationNew/index"),
        meta: { title: "销售凭证(分货单新)", role: [] }
      },
      {
        path: "salecertificationStore",
        name: "销售凭证(中仓订单)",
        id: 261800,
        parentId: 260000,
        component: () => import("@/views/voucher/salecertificationStore/index"),
        meta: { title: "销售凭证(中仓订单)", role: [] }
      },
      {
        path: "returncertificationNew",
        name: "退货凭证(新)",
        id: 261700,
        parentId: 260000,
        component: () => import("@/views/voucher/returncertificationNew/index"),
        meta: { title: "退货凭证(新)", role: [] }
      },
      {
        path: "returncertificationaddNew",
        name: "退货凭证(中仓自建)",
        id: 261800,
        parentId: 260000,
        component: () =>
          import("@/views/voucher/returncertificationaddNew/index"),
        meta: { title: "退货凭证(中仓自建)", role: [] }
      },
      {
        path: "superSalecertification",
        name: "商超销售凭证",
        id: 260200,
        parentId: 260000,
        component: () => import("@/views/voucher/superSalecertification/index"),
        meta: { title: "商超销售凭证", role: [] }
      },
      {
        path: "checkVoucher",
        name: "盘点凭证",
        id: 260300,
        parentId: 260000,
        component: () => import("@/views/voucher/checkVoucher/index"),
        meta: { title: "盘点凭证", role: [] }
      },
      {
        path: "purchaseVoucher",
        name: "采购凭证",
        id: 260400,
        parentId: 260000,
        component: () => import("@/views/voucher/purchaseVoucher/index"),
        meta: { title: "采购凭证", role: [] }
      },
      {
        path: "adjustmentVoucher",
        name: "改账凭证",
        id: 262400,
        parentId: 260000,
        component: () => import("@/views/voucher/adjustmentVoucher/index"),
        meta: { title: "改账凭证", role: [] }
      },
      {
        path: "superAdjustmentVoucher",
        name: "商超改账凭证",
        id: 262500,
        parentId: 260000,
        component: () => import("@/views/voucher/superAdjustmentVoucher/index"),
        meta: { title: "商超改账凭证", role: [] }
      },
      {
        path: "superPurchaseVoucher",
        name: "商超采购凭证",
        id: 260500,
        parentId: 260000,
        component: () => import("@/views/voucher/superPurchaseVoucher/index"),
        meta: { title: "商超采购凭证", role: [] }
      },
      {
        path: "Inputcertification",
        name: "加工厂产成品入库凭证",
        id: 260600,
        parentId: 260000,
        component: () => import("@/views/voucher/Inputcertification/index"),
        meta: { title: "加工厂产成品入库凭证", role: [] }
      },

      {
        path: "Outputcertification",
        name: "加工厂生成领用单",
        id: 260700,
        parentId: 260000,
        component: () => import("@/views/voucher/Outputcertification/index"),
        meta: { title: "加工厂生成领用单", role: [] }
      },

      {
        path: "Statementcertification",
        name: "结算单凭证",
        id: 260800,
        parentId: 260000,
        component: () => import("@/views/voucher/Statementcertification/index"),
        meta: { title: "结算单凭证", role: [] }
      },
      {
        path: "superStatementcertification",
        name: "商超结算凭证",
        id: 260900,
        parentId: 260000,
        component: () =>
          import("@/views/voucher/superStatementcertification/index"),
        meta: { title: "商超结算凭证", role: [] }
      },
      {
        path: "rebatesSettlement",
        name: "商超返点结算凭证",
        id: 261000,
        parentId: 260000,
        component: () => import("@/views/voucher/rebatesSettlement/index"),
        meta: { title: "商超返点结算凭证", role: [] }
      },
      {
        path: "rebatesSettlementAll",
        name: "商超返点结算凭证(全部)",
        id: 262100,
        parentId: 260000,
        component: () => import("@/views/voucher/rebatesSettlementAll/index"),
        meta: { title: "商超返点结算凭证(全部)", role: [] }
      },
      {
        path: "superShopfication",
        name: "商超门店返货凭证",
        id: 261100,
        parentId: 260000,
        component: () => import("@/views/voucher/superShopfication/index"),
        meta: { title: "商超门店返货凭证", role: [] }
      },
      {
        path: "superShopfications",
        name: "商超收门店返货凭证",
        id: 261200,
        parentId: 260000,
        component: () => import("@/views/voucher/superShopfications/index"),
        meta: { title: "商超收门店返货凭证", role: [] }
      },
      {
        path: "superReturnfications",
        name: "商超返货凭证",
        id: 261300,
        parentId: 260000,
        component: () => import("@/views/voucher/superReturnfications/index"),
        meta: { title: "商超返货凭证", role: [] }
      },
      {
        path: "highLowReturnfications",
        name: "高退低进凭证",
        id: 261400,
        parentId: 260000,
        component: () => import("@/views/voucher/highLowReturnfications/index"),
        meta: { title: "高退低进凭证", role: [] }
      },
      {
        path: "Certification",
        name: "区域收超市统配凭证",
        id: 261500,
        parentId: 260000,
        component: () => import("@/views/voucher/Certification/index"),
        meta: { title: "区域收超市统配凭证", role: [] }
      },
      {
        path: "receive",
        name: "调拨接收凭证",
        id: 261900,
        parentId: 260000,
        component: () => import("@/views/voucher/receive/index"),
        meta: { title: "调拨接收凭证", role: [] }
      },
      {
        path: "callout",
        name: "调拨调出凭证",
        id: 262000,
        parentId: 260000,
        component: () => import("@/views/voucher/callout/index"),
        meta: { title: "调拨调出凭证", role: [] }
      },
      {
        path: "commercialExcessPayment",
        name: "商超付款流水凭证",
        id: 262200,
        parentId: 260000,
        component: () =>
          import("@/views/voucher/commercialExcessPayment/index"),
        meta: { title: "商超付款流水凭证", role: [] }
      },
      {
        path: "excessPayment",
        name: "中仓付款流水凭证",
        id: 262300,
        parentId: 260000,
        component: () => import("@/views/voucher/excessPayment/index"),
        meta: { title: "中仓付款流水凭证", role: [] }
      }
    ]
  },
  // {
  //     path: '/difference',
  //     component: Layout,
  //     redirect: '/difference/differenceList',
  //     name: '商超差异单',
  //     id: 270000,
  //     meta: { title: '商超差异单', icon: 'difference', role: [] },
  //     children: [{
  //         path: 'differenceList',
  //         name: '商超差异单',
  //         id: 270100,
  //         parentId: 270000,
  //         component: () =>
  //             import('@/views/difference/differenceList/index'),
  //         meta: { title: '商超差异单', role: [] }
  //     }]

  // },
  {
    path: "/buyerReturn",
    component: Layout,
    redirect: "/buyerReturn/buyerReturnList",
    name: "商超采购员",
    id: 280000,
    meta: {
      title: "商超采购员",
      icon: "buyerReturn",
      role: []
    },
    children: [
      {
        path: "buyerReturnList",
        name: "商超采购员列表",
        id: 280100,
        parentId: 280000,
        component: () => import("@/views/buyerReturn/buyerReturnList/index"),
        meta: { title: "商超采购员列表", role: [] }
      }
    ]
  },
  {
    path: "/regionReturn",
    component: Layout,
    redirect: "/regionReturn/regionReturnList",
    name: "商超区域管理",
    id: 290000,
    meta: {
      title: "商超区域管理",
      icon: "regionReturn",
      role: []
    },
    children: [
      {
        path: "regionReturnList",
        name: "商超区域列表",
        id: 290100,
        parentId: 290000,
        component: () => import("@/views/regionReturn/regionReturnList/index"),
        meta: { title: "商超区域列表", role: [] }
      }
    ]
  },
  {
    path: "/expenseDoc",
    component: Layout,
    redirect: "/expenseDoc/expenseDocList",
    name: "费用单",
    id: 410000,
    meta: {
      title: "费用单",
      icon: "feiyong",
      role: []
    },
    children: [
      {
        path: "expenseDocList",
        name: "费用单列表",
        id: 410100,
        parentId: 410000,
        component: () => import("@/views/expenseDoc/expenseDocList/index"),
        meta: { title: "费用单列表", role: [] }
      },
      {
        path: "expenseItems",
        name: "费用项目列表",
        id: 410200,
        parentId: 410000,
        component: () => import("@/views/expenseDoc/expenseItems/index"),
        meta: { title: "费用项目列表", role: [] }
      }
    ]
  },
  {
    path: "/suppliersSupermarket",
    component: Layout,
    redirect: "/suppliersSupermarket",
    name: "商超供应商商品绑定列表",
    id: 420000,
    meta: {
      title: "商超供应商商品绑定列表",
      icon: "bangding",
      role: []
    },
    children: [
      {
        path: "suppliersSupermarket",
        name: "商超供应商商品绑定列表",
        id: 420100,
        parentId: 420000,
        component: () => import("@/views/suppliersSupermarket/index"),
        meta: { title: "商超供应商商品绑定列表", role: [] }
      }
    ]
  },
  // {
  //     path: '/stockReturn',
  //     component: Layout,
  //     redirect: '/stockReturn/stockReturnList',
  //     name: '商超高退低进操作',
  //     id: 300000,
  //     meta: {
  //         title: '商超高退低进操作',
  //         icon: 'stockReturn',
  //         role: []
  //     },
  //     children: [{
  //         path: 'stockReturnList',
  //         name: '高退低进库存列表',
  //         id: 300100,
  //         parentId: 300000,
  //         component: () =>
  //             import('@/views/stockReturn/stockReturnList/index'),
  //         meta: { title: '高退低进库存列表', role: [] }
  //     }, {
  //         path: 'stockindexList',
  //         name: '高退低进操作列表',
  //         id: 300200,
  //         parentId: 300000,
  //         component: () =>
  //             import('@/views/stockReturn/stockindexList/index'),
  //         meta: { title: '高退低进操作列表', role: [] }
  //     }],
  // },
  {
    path: "/bill",
    component: Layout,
    redirect: "/bill/billPurchase",
    name: "发票管理",
    id: 390000,
    meta: { title: "发票管理", icon: "invoice", role: [] },
    children: [
      {
        path: "billPurchase",
        name: "中仓采购数据",
        id: 390100,
        parentId: 390000,
        component: () => import("@/views/bill/billPurchase/index"),
        meta: { title: "中仓采购数据", role: [] }
      },
      {
        path: "billTicket",
        name: "中仓采购要票单",
        id: 390200,
        parentId: 390000,
        component: () => import("@/views/bill/billTicket/index"),
        meta: { title: "中仓采购要票单", role: [] }
      },
      {
        path: "billInvoice",
        name: "中仓发票管理",
        id: 390300,
        parentId: 390000,
        component: () => import("@/views/bill/billInvoice/index"),
        meta: { title: "中仓发票管理", role: [] }
      },
      // {
      //   path: "invoiceMatching",
      //   name: "中仓采购发票匹配",
      //   id: 390400,
      //   parentId: 390000,
      //   component: () => import("@/views/bill/invoiceMatching/index"),
      //   meta: { title: "中仓采购发票匹配", role: [] }
      // },
      {
        path: "billSuperPurchase",
        name: "商超采购数据",
        id: 390500,
        parentId: 390000,
        component: () => import("@/views/bill/billSuperPurchase/index"),
        meta: { title: "商超采购数据", role: [] }
      },
      {
        path: "billSuperTicket",
        name: "商超采购要票单",
        id: 390600,
        parentId: 390000,
        component: () => import("@/views/bill/billSuperTicket/index"),
        meta: { title: "商超采购要票单", role: [] }
      },
      {
        path: "billSuperInvoice",
        name: "商超发票管理",
        id: 390700,
        parentId: 390000,
        component: () => import("@/views/bill/billSuperInvoice/index"),
        meta: { title: "商超发票管理", role: [] }
      },
      // {
      //   path: "invoiceSuperMatching",
      //   name: "商超采购发票匹配",
      //   id: 390800,
      //   parentId: 390000,
      //   component: () => import("@/views/bill/invoiceSuperMatching/index"),
      //   meta: { title: "商超采购发票匹配", role: [] }
      // },
      {
        path: "billBond",
        name: "发票商品信息列表",
        id: 390900,
        parentId: 390000,
        component: () => import("@/views/bill/billBond/index"),
        meta: { title: "发票商品信息列表", role: [] }
      },
      {
        path: "billMatchFailed",
        name: "发票匹配失败记录",
        id: 391000,
        parentId: 390000,
        component: () => import("@/views/bill/billMatchFailed/index"),
        meta: { title: "发票匹配失败记录", role: [] }
      }
    ]
  },

  {
    path: "/personal",
    component: Layout,
    redirect: "/personal",
    name: "个人中心",
    id: 310000,
    meta: { title: "", icon: "personal", role: [] },
    children: [
      {
        path: "personal",
        name: "个人中心",
        id: 310100,
        parentId: 310000,
        component: () => import("@/views/personal/index"),
        meta: { title: "个人中心", role: [] }
      }
    ]
  },
  {
    path: "/setting",
    component: Layout,
    redirect: "/setting",
    name: "系统设置",
    id: 320000,
    meta: { title: "", icon: "setting", role: [] },
    children: [
      {
        path: "setting",
        name: "系统设置",
        id: 320100,
        parentId: 320000,
        component: () => import("@/views/setting/index"),
        meta: { title: "系统设置", role: [] }
      }
    ]
  },
  {
    path: "/salesMarginChart",
    component: Layout,
    redirect: "/salesMarginChart/salesMarginCollect",
    name: "销售毛利数据",
    id: 330000,
    meta: { title: "销售毛利数据", icon: "chart", role: [] },
    children: [
      {
        path: "salesMarginCollect",
        name: "销售毛利汇总查询",
        id: 330100,
        parentId: 330000,
        component: () =>
          import("@/views/salesMarginChart/salesMarginCollect/index"),
        meta: { title: "销售毛利汇总查询", role: [] },
        children: [
          {
            path: "organizationSalesMarginCollect",
            name: "机构销售毛利汇总查询",
            id: 330101,
            parentId: 330100,
            component: () =>
              import("@/views/salesMarginChart/salesMarginCollect/organizationSalesMarginCollect/index"),
            meta: { title: "机构销售毛利汇总查询", role: [] }
          },
          {
            path: "categorySalesMarginCollect",
            name: "品类销售毛利汇总查询",
            id: 330102,
            parentId: 330100,
            component: () =>
              import("@/views/salesMarginChart/salesMarginCollect/categorySalesMarginCollect/index"),
            meta: { title: "品类销售毛利汇总查询", role: [] }
          },
          {
            path: "brandSalesMarginCollect",
            name: "品牌销售毛利汇总查询",
            id: 330103,
            parentId: 330100,
            component: () =>
              import("@/views/salesMarginChart/salesMarginCollect/brandSalesMarginCollect/index"),
            meta: { title: "品牌销售毛利汇总查询", role: [] }
          },
          {
            path: "tissueSalesMarginCollect",
            name: "组织部门销售毛利汇总查询",
            id: 330104,
            parentId: 330100,
            component: () =>
              import("@/views/salesMarginChart/salesMarginCollect/tissueSalesMarginCollect/index"),
            meta: { title: "组织部门销售毛利汇总查询", role: [] }
          },
          {
            path: "supplierSalesMarginCollect",
            name: "供应商销售毛利汇总查询",
            id: 330105,
            parentId: 330100,
            component: () =>
              import("@/views/salesMarginChart/salesMarginCollect/supplierSalesMarginCollect/index"),
            meta: { title: "供应商销售毛利汇总查询", role: [] }
          },
          {
            path: "marketSalesMarginCollect",
            name: "商品销售毛利汇总查询",
            id: 330106,
            parentId: 330100,
            component: () =>
              import("@/views/salesMarginChart/salesMarginCollect/marketSalesMarginCollect/index"),
            meta: { title: "商品销售毛利汇总查询", role: [] }
          }
        ]
      }
    ]
  },
  // {
  //     path: '/datatable',
  //     component: Layout,
  //     redirect: '/datatable/datatableList',
  //     name: '数据报表',
  //     id: 340000,
  //     meta: { title: '数据报表', icon: 'datatable', role: [] },
  //     children: [{
  //         path: 'datatableList',
  //         name: '门店销售数据报表',
  //         id: 340100,
  //         parentId: 340000,
  //         component: () =>
  //             import('@/views/datatable/datatableList/index'),
  //         meta: { title: '门店销售数据报表', role: [] }
  //     }, {
  //         path: 'ProductClassdatatable',
  //         name: '区域销售额数据报表',
  //         id: 340200,
  //         parentId: 340000,
  //         component: () =>
  //             import('@/views/datatable/ProductClassdatatable/index'),
  //         meta: { title: '区域销售额数据报表', role: [] }
  //     },
  //         // {
  //         //     path: 'grossMarginReport',
  //         //     name: '毛利报表',
  //         //     id: 340300,
  //         //     parentId: 340000,
  //         //     component: () =>
  //         //         import ('@/views/datatable/grossMarginReport/index'),
  //         //     meta: { title: '毛利报表', role: [] }
  //         // }
  //     ]

  // },
  {
    path: "/process",
    component: Layout,
    redirect: "/process/processList",
    name: "商超加工列表",
    id: 370000,
    meta: { title: "商超加工列表", icon: "process", role: [] },
    children: [
      {
        path: "processList",
        name: "商超加工列表",
        id: 370100,
        parentId: 370000,
        component: () => import("@/views/process/processList/index"),
        meta: { title: "商超加工列表", role: [] }
      }
    ]
  },

  // {
  //     path: '/invoice',
  //     component: Layout,
  //     redirect: '/invoice/invoiceList',
  //     name: '发票管理',
  //     id: 390000,
  //     meta: { title: '发票管理', icon: 'invoice', role: [] },
  //     children: [{
  //         path: 'invoiceList',
  //         name: '发票管理',
  //         id: 390100,
  //         parentId: 390000,
  //         component: () =>
  //             import('@/views/invoice/invoiceList/index'),
  //         meta: { title: '发票管理列表', role: [] }
  //     }]

  // },

  {
    path: "*",
    name: "404",
    component: () => import("@/views/404"),
    hidden: true
  }
];

const createRouter = () =>
  new Router({
    // mode: 'history', // require service support
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
  });

const router = createRouter();

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter();
  router.matcher = newRouter.matcher; // reset router
}
export default router;
